import request from '@/utils/request'

// 查询代理商管理列表
export function listAgent(query) {
  return request({
    url: '/client/agent/list',
    method: 'get',
    params: query
  })
}

// 查询代理商管理详细
export function getAgent(agentId) {
  return request({
    url: '/client/agent/' + agentId,
    method: 'get'
  })
}

// 新增代理商管理
export function addAgent(data) {
  return request({
    url: '/client/agent',
    method: 'post',
    data: data
  })
}

// 修改代理商管理
export function updateAgent(data) {
  return request({
    url: '/client/agent',
    method: 'put',
    data: data
  })
}

// 删除代理商管理
export function delAgent(agentId) {
  return request({
    url: '/client/agent/' + agentId,
    method: 'delete'
  })
}

// 用户状态修改
export function changeUserStatus(agentId, agentStatus) {
  const data = {
    agentId,
    agentStatus
  }
  return request({
    url: '/client/agent/changeStatus',
    method: 'put',
    data: data
  })
}